package com.example.demo.mapper;

import com.example.demo.entity.Employee;
import org.springframework.jdbc.core.RowMapper;

import java.sql.ResultSet;
import java.sql.SQLException;


public class EmpMapper implements RowMapper<Employee> {

    @Override
    public Employee mapRow(ResultSet resultSet, int i) throws SQLException {
        Employee emp = new Employee();
        emp.setUserName(resultSet.getString("USERNAME"));
        emp.setName(resultSet.getString("REALNAME"));
        emp.setCert(resultSet.getString("CERT"));
        emp.setBirthday(resultSet.getDate("BIRTHDAY"));
        return emp;
    }
}
